{% extends "base.html" %}

{% block header %}
header...
{% endblock %}

{% block content %}
    <div class="pageHeader">
        <form onsubmit="return navTabSearch(this);" action="{{full_path}}" method="post">
            <div class="searchBar">

                <table class="searchContent">
                    <tbody><tr>
                        <!-- <td>
                            帐号：<input type="text" name="keyword" class="textInput">
                        </td> -->
                        <td>
                            起始日期：<input type="text" name="dt1" class="date textInput readonly" value="{{dt1|date:'Y-m-d'}}" readonly="true">
                        </td>
                        <td>
                            终止日期：<input type="text" name="dt2" class="date textInput readonly" value="{{dt2|date:'Y-m-d'}}" readonly="true">
                        </td>
                    </tr>
                    </tbody></table>
                <div class="subBar">
                    <ul>
                        <li><div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div></li>

                    </ul>
                </div>
            </div>
        </form>
    </div>


    <h1>&nbsp;&nbsp;{%if who %}{{who}}{%else%}{% if '/checkin/dept' in full_path %}{{my_dept.name}}{%else%}{% if '/checkin/branch/' in full_path %}{{dept.name}}{%else%}我{%endif%}{%endif%}的考勤{%endif%}</h1>
    <br/>
    <div class="pageContent">
    <table class="list" width="100%" >
        <thead>
          <tr>
            <!-- <th style="width: 100px; cursor: default; ">编号</th> -->
            {% if '/checkin/dept' in full_path or '/checkin/branch/' in full_path  or '/checkin/absence/dept' in full_path %}
            <th>姓名</th>
            {%endif%}
            <th>日期</th>
            <th>签到时间</th>
            <th>签退时间</th>
            <th>编辑人</th>
          <!-- mincat @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 
            <th>上班时间</th>
            <th>下班时间</th>
            <th>签到时间</th>
            <th>签退时间</th>
            <th>考勤状态(正常/请假/异常)</th>
          -->
          </tr>
        </thead>
        <tbody>
          {%for log in list.object_list%}
          <tr>
            {% if '/checkin/dept' in full_path or '/checkin/branch/' in full_path  or '/checkin/absence/dept' in full_path %}
            <td>{{log.user.last_name}}</td>
            {%endif%}
            <td>{{log.created_date|date:"Y-m-d"}}</td>
            <td>{% if log.first_login_time %}{{log.first_login_time}}{%endif%}</td>
            <td>{% if log.last_logout_time %}{{log.last_logout_time}}{%endif%}</td>
            <td>{% if log.edited_by_id %}{{log.edited_by.username}}{%endif%}</td>
          </tr>
          {%endfor%}
        </tbody>
      </table>
    </div>

    <div class="panelBar hover">
      <div class="pagination" targettype="navTab" totalcount="{{list.count}}" numperpage="10" pagenumshown="10" currentpage="{{list.number}}"></div>
    </div>
{% endblock %}